package lesson2;

import java.util.Scanner;

public class WhileLoopExample {

	public static void main(String... args) {

		//input number n
		//print the following output based on n
		//for n = 3:
		
		/**
		 *if n = 3:
		 *1 2 3
		 *2 4 6
		 *3 6 9
		 *
		 *if n = 4
		 *1 2 3 4
		 *2 4 6 8
		 *3 6 9 12
		 *4 8 12 16
		 */
		
		Scanner sc = new Scanner(System.in);
		
		System.out.println("ADD A NUMBER");
		int n  = sc.nextInt();
		
		int initial = 1;
		
		while(initial <= n)//each row is printed
		{
			int rowHelper = initial;
			int x = 1;
			while( x <= n)//each number is printed on row
			{
				System.out.print(rowHelper+ " ");
				x++;
				rowHelper+=initial;
			}
			initial++;
			System.out.println();
		}
		
	}
}
